<!DOCTYPE html>
<html>

<body>
<script>
var htmlTag=new Object();
htmlTag.name="JJ";
htmlTag.id="Doe";
htmlTag.age=50;
htmlTag.eyecolor="blue"; 
document.write("<span onmouseover='this.title=this.outerHTML'>" + htmlTag.name + " is " + htmlTag.age + " years old." + "</span>");
</script>
<h1 onmouseover="this.title=this.localName">Click on this text!</h1>
<div id="previewArea"></div>

</body>
</html>